package ui;

import java.io.File;

public class FileUtils 
{
	public static File[] findFiles(String directoryPath) 
	{
		File directory = new File(directoryPath);
		
		if(directory.exists() && directory.isDirectory())
		{
			return directory.listFiles();
		}
		return new File[0];
	}
	
	public static int count(String beginStr, File[] files)
	{
		int count = 0;
		for(int i = 0; i < files.length; i++)
		{
			if(files[i].getName().contains(beginStr))
			{
				count++;
			}
		}
		return count;
	}
}
